﻿using System;

public class UrlBuilder
{
    public static string location = "http://linhson.suoinguontinhthuong.vn";

    public static string GetAlbum()
    {
        return "/thu-vien-anh/trang-{0}.html";
    }

    public static string GetAlbumDetail(string albumtextid)
    {
        return ("/thu-vien-anh/" + albumtextid + ".html");
    }

    public static string GetAlbumPaging()
    {
        return "/thu-vien-anh/trang-{0}.html";
    }

    public static string GetAuthor(string Author)
    {
        return ("/author/" + Author + ".html");
    }

    public static string GetAuthorPaging(string Author)
    {
        return ("/author/" + Author + "/trang-{0}.html");
    }

    public static string GetCategory(string TextId)
    {
        return ("/category/" + TextId + ".html");
    }

    public static string GetCategoryPaging(string TextId)
    {
        return ("/category/" + TextId + "/trang-{0}.html");
    }

    public static string GetImage(string Url, int w)
    {
        if (Url == "")
        {
            Url = "css/images/noimage.jpg";
        }
        return (location + string.Format("{0}?w={1}", Url, w));
    }

    public static string GetImage(string Url, int w, bool c)
    {
        if (Url == "")
        {
            Url = "css/images/noimage.jpg";
        }
        return (location + string.Format("{0}?w={1}&c=1", Url, w));
    }

    public static string GetImage(string Url, int w, int h)
    {
        if (Url == "")
        {
            Url = "/images/noimage.jpg";
        }
        return (location + string.Format("{0}?w={1}&h={2}", Url, w, h));
    }

    public static string GetImage(string Url, int w, int h, bool c)
    {
        if (Url == "")
        {
            Url = "/images/noimage.jpg";
        }
        if (c)
        {
            return (location + string.Format("{0}?w={1}&h={2}&c=1", Url, w, h));
        }
        return (location + string.Format("{0}?w={1}&h={2}", Url, w, h));
    }

    public static string GetNewsDetail(string TextId, object datetime)
    {
        return ("/" + DateTime.Parse(datetime.ToString()).ToString("d/M/yyyy") + "/" + TextId + ".html");
    }

    public static string GetTags(string TextId)
    {
        return ("/tags/" + TextId + ".html");
    }

    public static string GetTagsPaging(string TextId)
    {
        return ("/tags/" + TextId + "/trang-{0}.html");
    }

    public static string GetVideo()
    {
        return "/thu-vien-video/trang-{0}.html";
    }

    public static string GetVideoDetail(string videotextid)
    {
        return ("/thu-vien-video/" + videotextid + ".html");
    }

    public static string GetVideoPaging()
    {
        return "/thu-vien-video/trang-{0}.html";
    }
}

